﻿using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace WcMatch.Migrations.StuResume
{
    /// <inheritdoc />
    public partial class Update2023050401 : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropPrimaryKey(
                name: "PK_T_StuResume",
                table: "T_StuResume");

            migrationBuilder.RenameColumn(
                name: "Dsp",
                table: "T_StuResume",
                newName: "Others");

            migrationBuilder.AlterColumn<string>(
                name: "UId",
                table: "T_StuResume",
                type: "varchar(20)",
                maxLength: 20,
                nullable: false,
                collation: "utf8_general_ci",
                oldClrType: typeof(int),
                oldType: "int",
                oldMaxLength: 20)
                .Annotation("MySql:CharSet", "utf8");

            migrationBuilder.AlterColumn<string>(
                name: "CitizenId",
                table: "T_StuResume",
                type: "longtext",
                nullable: false,
                collation: "utf8_general_ci",
                oldClrType: typeof(string),
                oldType: "varchar(255)")
                .Annotation("MySql:CharSet", "utf8")
                .OldAnnotation("MySql:CharSet", "utf8")
                .OldAnnotation("Relational:Collation", "utf8_general_ci");

            migrationBuilder.AddColumn<string>(
                name: "ResumeId",
                table: "T_StuResume",
                type: "varchar(255)",
                nullable: false,
                defaultValue: "",
                collation: "utf8_general_ci")
                .Annotation("MySql:CharSet", "utf8");

            migrationBuilder.AddColumn<int>(
                name: "Delete",
                table: "T_StuResume",
                type: "int",
                nullable: true);

            migrationBuilder.AddPrimaryKey(
                name: "PK_T_StuResume",
                table: "T_StuResume",
                column: "ResumeId");
        }

        /// <inheritdoc />
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropPrimaryKey(
                name: "PK_T_StuResume",
                table: "T_StuResume");

            migrationBuilder.DropColumn(
                name: "ResumeId",
                table: "T_StuResume");

            migrationBuilder.DropColumn(
                name: "Delete",
                table: "T_StuResume");

            migrationBuilder.RenameColumn(
                name: "Others",
                table: "T_StuResume",
                newName: "Dsp");

            migrationBuilder.AlterColumn<int>(
                name: "UId",
                table: "T_StuResume",
                type: "int",
                maxLength: 20,
                nullable: false,
                oldClrType: typeof(string),
                oldType: "varchar(20)",
                oldMaxLength: 20)
                .OldAnnotation("MySql:CharSet", "utf8")
                .OldAnnotation("Relational:Collation", "utf8_general_ci");

            migrationBuilder.AlterColumn<string>(
                name: "CitizenId",
                table: "T_StuResume",
                type: "varchar(255)",
                nullable: false,
                collation: "utf8_general_ci",
                oldClrType: typeof(string),
                oldType: "longtext")
                .Annotation("MySql:CharSet", "utf8")
                .OldAnnotation("MySql:CharSet", "utf8")
                .OldAnnotation("Relational:Collation", "utf8_general_ci");

            migrationBuilder.AddPrimaryKey(
                name: "PK_T_StuResume",
                table: "T_StuResume",
                column: "CitizenId");
        }
    }
}
